# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gtkd
pkgver=3.9.0
pkgrel=2
pkgdesc="D bindings for GTK+3 and related libraries"
url="https://gtkd.org"
arch="x86 x86_64 aarch64" # ldc
license="LGPL-3.0-or-later"
makedepends="ldc ldc-runtime gstreamer-dev gtksourceview-dev libpeas-dev
	librsvg-dev vte3-dev"
options="!check"
subpackages="$pkgname-dev"
source="https://github.com/gtkd-developers/GtkD/archive/v$pkgver/gtkd-$pkgver.tar.gz"
builddir="$srcdir/GtkD-$pkgver"

prepare() {
	default_prepare

	# Fix the install location of pkgconfig files
	sed 's|$(DESTDIR)$(libdir)|$(DESTDIR)$(prefix)/$(libdir)|' -i GNUmakefile
}

build() {
	make shared LDFLAGS='-linker=bfd -link-defaultlib-shared'
}

package() {
	make LDFLAGS='-linker=bfd -link-defaultlib-shared' DESTDIR="$pkgdir" prefix=/usr \
		install-shared install-headers
}

sha512sums="ea83322933958fa62883bc5f9d9c37fca78c369f6567b4fd62bd39d5d41b7caaab186752a836904b70c1dd70370d683bf35ae3e9201cac12410356ad4c020b90  gtkd-3.9.0.tar.gz"
